package com.xhdx.modules.boot.web.message;

import com.baomidou.mybatisplus.core.metadata.IPage;

/**
 * 分页对象转换类
 *
 * @author xhdx
 * @date 2020-04-17
 **/
public class PageParameterUtil {

    /**
     * Utility classes should not have public constructors
     */
    private PageParameterUtil() {
    }

    public static void buildPageParameter(IPage page, PageParameter pageParameter) {
        if (page != null) {
            pageParameter.setPageSize((int) page.getSize());
            pageParameter.setCurrentPage((int) page.getCurrent());
            pageParameter.setTotalCount((int) page.getTotal());
            pageParameter.setTotalPage((int) page.getPages());
        }
    }
}
